<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>事件处理</title>
		<script src="../js/vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="root">
			<h2>欢迎来到{{name}}学习</h2>
			<!-- <button type="button" v-on:click="showInfo">点我提示信息</button> -->
			<!-- 简写形式 -->
			<button type="button" @click="showInfo1">点我提示信息1(不传参)</button>
			<button type="button" @click="showInfo2(66,$event)">点我提示信息2(传参)</button>
		</div>
		<script type="text/javascript">
			Vue.config.productionTip = false;
			new Vue({
				el:"#root",
				data:{
					name:"尚硅谷"
				},
				methods:{
					showInfo1(event){
						alert("同学你好!")
					},
					showInfo2(number,event){
						alert("同学你好!!")
						console.log(number,event)
					}
				}
			})
		</script>
	</body>
</html>
